﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MyWeb.WebUI.Models
{
	public class PagingModel
	{
		public int TotalItems 
		{ 
			get; 
			private set; 
		}
		public int ItemsPerPage 
		{ 
			get; 
			private set; 
		}
		public int CurrentPage 
		{ 
			get; 
			private set; 
		}
		public int TotalPages 
		{
			get { return (int)Math.Ceiling((decimal)this.TotalItems / this.ItemsPerPage); }
		}


		
		public PagingModel (int totalItems, int itemsPerPage, int currentPage)
		{
			this.TotalItems = totalItems;
			this.ItemsPerPage = itemsPerPage;
			this.CurrentPage = currentPage;
		}
	}
}